using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WeaponObj : MonoBehaviour
{
    //子弹对象
    public GameObject bullet;
    //发射位置
    public Transform[] shootPos;
    //武器拥有者
    public TankBaseObj fatherObj;
    public void SetFather(TankBaseObj obj)
    {
        fatherObj = obj;
    }
    public void Fire()
    {
        foreach (var item in shootPos)
        {
            GameObject obj = Instantiate(bullet, item.position, item.rotation);
            BulletObj bulletObj = obj.GetComponent<BulletObj>();
            bulletObj.setFather(fatherObj);
        }
    }
}
